<template>
	<div>
		<image src="../../static/index/个人中心@2x.png" mode="widthFix" class="avatar posf" @click="open('../user/user')">
		</image>
		<image src="../../static/index/logo3.png" mode="widthFix" class="logo"></image>
		<div class="main">
			<div class="box">
				<div class="mb20">
					<button @click="openChat">开启对话</button>
				</div>
			</div>
		</div>
	</div>
</template>

<script setup>
	// import {
	// 	getCurrentInstance
	// } from 'vue'
	// const {
	// 	proxy
	// } = getCurrentInstance()
	function guid() {
		return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
			var r = Math.random() * 16 | 0,
				v = c == 'x' ? r : (r & 0x3 | 0x8);
			return v.toString(16);
		});
	}

	function openChat() {
		const uid = guid()
		uni.redirectTo({
			url: '../detail/detail?bootId=7474824325276139561&uid=' + uid
		})
		// proxy.open(`../detail/detail?bootId=7474824325276139561`)
	}
</script>

<style lang='scss' scoped>
	.main {
		padding: 0rpx 20rpx 80rpx;

		.box {
			padding: 35rpx 26rpx 16rpx;

		}
	}

	.logo {
		width: 170rpx;
		height: 220rpx;
		display: block;
		margin: 220rpx auto 75rpx;
	}

	.avatar {
		width: 60rpx;
		height: 60rpx;
		left: 30rpx;
		top: 100rpx;
	}
</style>